<?php
class ProprieteValue{
	private $id;
	private $proprieteId;
	private $entiteId;
	private $Langue;
	private $ReferencedEntite;
	private $valueShort;
	private $valueText;
	private $listValue;
	private $dateFrom;
	private $dateTo;
	private $duration;
	private $checked;

	function __construct($id) {

		if (is_int($id)){
			if($id >= 0){
				$this->id=$id;
			}else{
				throw new FieldFormatException($_SESSION['translator']->idVal);
			}
		}else{
			throw new FieldFormatException($_SESSION['translator']->idInt);
		}
	}
	function getProprieteId(){
		return $this->proprieteId;
	}
	function setProprieteId($id){
		if (is_int($id)){
			if($id >= 0){
				$this->id=$id;
			}else{
				throw new FieldFormatException($_SESSION['translator']->idVal);
			}
		}else{
			throw new FieldFormatException($_SESSION['translator']->idInt);
		}
	}
	function getLangue(){
		return $this->Langue;
	}
	function setLangue($Langue){
		if (is_a($Langue, "Langue")){
			$this->Langue = $Langue;
		}else{
			throw new FieldFormatException($_SESSION['translator']->reqInstance." Langue.");
		}
	}
	function getEntiteId(){
		return $this->entiteId;
	}
	function setEntiteId($id){
		if (is_int($id)){
			if($id >= 0){
				$this->id=$id;
			}else{
				throw new FieldFormatException($_SESSION['translator']->idVal);
			}
		}else{
			throw new FieldFormatException($_SESSION['translator']->idInt);
		}
	}
	function getReferencedEntite(){
		return $this->ReferencedEntite;
	}
	function setReferencedEntite($Entite){
		if(is_a($Entite, "Entite") || is_null($Entite)){
			$this->ReferencedEntite = $Entite;
		}else{
			throw new FieldFormatException($_SESSION['translator']->reqInstance." Entite.");
		}
	}
	function getValueShort(){
		return $this->valueShort;
	}
	function setValueShort($val){
		$this->valueShort = $val;
	}
	function getValueText(){
		return $this->valueText;
	}
	function setValueText($val){
		$this->valueText = $val;
	}
	function getListeValue(){
		return $this->listValue;
	}
	function setListeValue($ListValue){
		var_dump($ListValue);
		if (is_a($ListValue, "ListeValue")){
			$this->listValue = $ListValue;
		}else{
			throw new FieldFormatException($_SESSION['translator']->reqInstance." ListeValue.");
		}
	}
	function getDateFrom(){
		return $this->dateFrom;
	}
	function setDateFrom($day,$month,$year){
		//$mysqldate = date( 'Y-m-d H:i:s', $phpdate );
		//$phpdate = strtotime( $mysqldate );
		if(Validator::validateDate($day,$month,$year)){
			$this->dateFrom=$year."/".$month."/".$day;
		}else{
			throw new FieldFormatException($_SESSION['badFormat']->reqInstance." ".$_SESSION['badFormat']->dateFrom);
		}
	}
	function getDateTo(){
		return $this->dateTo;
	}
	function setDateTo($day,$month,$year){
		//$mysqldate = date( 'Y-m-d H:i:s', $phpdate );
		//$phpdate = strtotime( $mysqldate );
		if(Validator::validateDate($day,$month,$year)){
			$this->dateTo=$year."/".$month."/".$day;
		}else{
			throw new FieldFormatException($_SESSION['badFormat']->reqInstance." ".$_SESSION['badFormat']->dateTo);
		}
	}
	function getDuration(){
		return $this->duration;
	}
	function setDuration($duration){
		$this->duration = $duration;
	}
	function getChecked(){
		return $this->checked;
	}
	function setChecked($checkBool){
		if($checkBool==1 || $checkBool == 0){
			$this->checked = $checkBool;
		}else{
			throw new FieldFormatException($_SESSION['badFormat']->boolErr);
		}
	}
}
?>